<?php
define('CONFIG_FORMAT', <<<EOT
<?php
setlocale(LC_ALL,'en_US.UTF8');
header('Content-Type: text/html; charset=utf-8');
if(!defined('PAGE_LOAD_START'))
	define("PAGE_LOAD_START", round(microtime(), 4));
define("DBHOST", "%s");
define("DBUSER", "%s");
define("DBPASS", "%s");
define("DBNAME", "%s");
define("DBTABLEPREFIX", "%s");
define("DBPORT", "%s");
define("DB_USE", "%s");
define("MYSQL_NUM_QUERIES", 0);
define("MYSQL_QUERY_TIME", 0);
define("LEMURCMS_VERSION", "1.3");
// Content Slug
define('CONTENT_SLUG', 'pages');

// WARNING: You can't have any pages with the same menu title under the same parent when this is set to true.
define('SIMPLE_CLEAN_URLS', %s);

// 
define('SIMPLE_CLEAN_URLS_FORMAT', '%%3\$s%%5\$s/%%4\$s');

// Perl Compatible Regular Exprtion (preg)
// Default '/'.CONTENT_SLUG.'\/[a-z-:]+/'
// not used
define('SIMPLE_CLEAN_URLS_REGEX', '/'.CONTENT_SLUG.'\/[a-z0-9-\/]+/');

// Normal Clean Url Format
// %%3\$s = root path
// %%1\$s = page id
// %%2\$s = page menu title
define('CLEAN_URLS_FORMAT', '%%3\$spages/%%1\$s/%%2\$s');

// Perl Compatible Regular Exprtion (preg)
// Default /pages\/[0-9]+\/[a-z-]+/
// not used
define('CLEAN_URL_REGEX','/'.CONTENT_SLUG.'\/[0-9]+\/[a-z0-9-]+/');

// Used when clean urls are disabled
define('UNCLEAN_URLS_FORMAT', '%%2\$s?%%4\$s=%%s');

require('config-functions.php');
define('PERMISSIONS_URL', BASE_URL.'includes/admin/permissions.php.inc');
define('GROUPS_URL', BASE_URL.'includes/admin/groups.php.inc');
?>
EOT
);
define('HTACCESS_FORMAT', <<<EOT
#
#BEGIN LemurCMS
#

# Hide .htaccess file from browser
<Files .htaccess>
order allow,deny
deny from all
</Files>


# Hide template files from browser
	<Files *.tpl>
		order allow,deny
		deny from all
	</Files>
	<Files *.tpl.php>
		order allow,deny
		deny from all
	</Files>
	<Files *.sql>
		order allow,deny
		deny from all
	</Files>
	<Files *.inc>
		order allow,deny
		deny from all
	</Files>
	
# Hide sqlite databases
	<Files *.sqlite3>
		order allow,deny
		deny from all
	</Files>
	
#    The next group is from Drupal, and is meant to lay done a base
# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings.
# but the following cannot be changed at runtime.

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On
  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600
  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>	
EOT
);
define('MOD_REWRITE_ENABLED_FORMAT', <<<EOT

# CLEAN URLS
# The RewriteBase rule should be absolute from the public folder.
# If your public folder is /html/public_html/, and you have LemurCMS in a folder called lemurcms then then the line would like this:
# 	RewriteBase %s
#
# Remove the pound signs from the next 5 lines to enable clean urls. You must have Apache with mod_rewrite for this to work otherwise it will through an error
<IfModule mod_rewrite.c>
	RewriteEngine on 
	RewriteBase %s
	RewriteCond %%{REQUEST_FILENAME} !-f
	RewriteCond %%{REQUEST_FILENAME} !-d
	RewriteRule search/(.*)$ index.php?page=search&q=$1 [L]
	RewriteCond %%{REQUEST_FILENAME} !-f
	RewriteCond %%{REQUEST_FILENAME} !-d
	RewriteRule ([0-9]+)/([a-zA-Z0-9]+) index.php?page=$1 [L]
	RewriteCond %%{REQUEST_FILENAME} !-f
	RewriteCond %%{REQUEST_FILENAME} !-d
	RewriteRule pages(/(.*)+)+ index.php?page=$1&%%{QUERY_STRING} [L]
</IfModule>
EOT
);
define('MOD_REWRITE_DISABLED_FORMAT', <<<EOT

# CLEAN URLS
# The RewriteBase rule should be absolute from the public folder.
# This is what your RewriteBase rule should look like:
# 	RewriteBase %1s
#
# Remove the pound signs from the next 5 lines to enable clean urls. You must have Apache with mod_rewrite for this to work otherwise it will through an error
#<IfModule mod_rewrite.c>
#	RewriteEngine on 
#	RewriteBase %s
#	RewriteCond %%{REQUEST_FILENAME} !-f
#	RewriteCond %%{REQUEST_FILENAME} !-d
#	RewriteRule search/(.*)$ index.php?page=search&q=$1 [L]
#	RewriteCond %%{REQUEST_FILENAME} !-f
#	RewriteCond %%{REQUEST_FILENAME} !-d
#	RewriteRule ([0-9]+)/ index.php?page=$1 [L]
#	RewriteCond %%{REQUEST_FILENAME} !-f
#	RewriteCond %%{REQUEST_FILENAME} !-d
#	RewriteRule pages(/(.*)+)+ index.php?page=$1&%{QUERY_STRING} [L]
#</IfModule>
EOT
);
?>